package com.tjhk.java.tech.io;

import java.io.*;
import java.util.stream.Collectors;

public class FileTest {
    public static String read(String fileName){
        try(BufferedReader in = new BufferedReader(new FileReader(fileName))) {
            return in.lines().collect(Collectors.joining("\n"));
        }catch (IOException e){
            throw new RuntimeException(e);
        }
    }
    public static void main(String[] args) throws IOException {
        PrintWriter printWriter = new PrintWriter(System.out,true);
        printWriter.println("eqweqeq");

//        StringReader in = new StringReader(read("FileTest.java"));
//        int c;
//        while ((c = in.read()) != -1) {
//            System.out.println((char) c);
//        }
    }
}
